//
//  CarTypeTableViewCell.m
//  怎么说呢
//
//  Created by 杜远洋 on 15-1-4.
//  Copyright (c) 2015年 蓝欧科技. All rights reserved.
//

#import "CarTypeTableViewCell.h"

@implementation CarTypeTableViewCell
- (void)dealloc
{
    [_nameLabel release];
    [_myImage release];
    [_priceLabel release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myImage = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, self.frame.size.width/3, self.frame.size.height - 10)];
        [self.myImage setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:self.myImage];
        [_myImage release];
        
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 2 / 5, 5, self.frame.size.width * 2 /5, self.frame.size.height/3)];
        [self.nameLabel setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width * 2 / 5, self.frame.size.height/2, self.frame.size.width * 2 /5, self.frame.size.height/3)];
        [self.priceLabel setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:self.priceLabel];
        [_priceLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    NSLog(@"%@",self);
    self.myImage.frame = CGRectMake(5, 5, self.frame.size.width/3, self.frame.size.height - 10);
    
    self.nameLabel.frame = CGRectMake(self.frame.size.width * 2 / 5, 5, self.frame.size.width * 2 /5, self.frame.size.height/3);
    
    self.priceLabel.frame = CGRectMake(self.frame.size.width * 2 / 5, self.frame.size.height/2, self.frame.size.width * 3 /5, self.frame.size.height/3);
    
    
}










- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
